# 分别通过jquery和pyquery将下面网址上几个维度的分类名称和网址抽取出来
# https://bj.fang.com/quanwangso/search.html?city=bj&refer=sy_seach
# https://www.guazi.com/bj/buy/
import requests
from pyquery import PyQuery as pq

# 网址
urls = [
    'https://bj.fang.com/quanwangso/search.html?city=bj&refer=sy_seach',
    'https://www.guazi.com/bj/buy/'
]

# 发送HTTP请求并解析HTML
for url in urls:
    response = requests.get(url)
    doc = pq(response.text)

    # 查找分类名称和链接（这里的代码是示例性的，你需要根据页面的实际HTML结构进行调整）
    items = doc('.some-class-name').items() # 替换为实际的类名选择器
    for item in items:
        category_name = item('.category-name-class').text() # 替换为实际的类名选择器
        category_url = item('.category-url-class').attr('href') # 替换为实际的类名选择器
        print('Category Name:', category_name)
        print('Category URL:', category_url)